.class public abstract Lcom/nemustech/tiffany/world/TFGridHolder;
.super Lcom/nemustech/tiffany/world/TFHolder;
.source "TFGridHolder.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/nemustech/tiffany/world/TFGridHolder$GridMoveAnimation;
    }
.end annotation


# static fields
.field public static final HORIZONTAL:I = 0x0

.field private static TAG:Ljava/lang/String; = null

.field public static final VERTICAL:I = 0x1


# instance fields
.field protected mDirection:I

.field protected mGroupHeight:F

.field protected mGroupSize:I

.field protected mGroupSpace:F

.field protected mItemSpace:F

.field protected mItemWidth:F

.field protected mMarginBottom:F

.field protected mMarginLeft:F

.field protected mMarginRight:F

.field protected mMarginTop:F

.field protected mScrollEndIndexOffset:I

.field protected mScrollStartIndexOffset:I

.field protected mViewHeight:F

.field protected mViewWidth:F


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 703
    const-string v0, "TFGridHolder"

    sput-object v0, Lcom/nemustech/tiffany/world/TFGridHolder;->TAG:Ljava/lang/String;

    return-void
.end method

.method public constructor <init>()V
    .locals 4

    .prologue
    const/high16 v3, 0x3f80

    const/4 v2, 0x0

    const v1, 0x3dcccccd

    .line 10
    invoke-direct {p0}, Lcom/nemustech/tiffany/world/TFHolder;-><init>()V

    .line 11
    new-instance v0, Lcom/nemustech/tiffany/world/TFGridHolder$GridMoveAnimation;

    invoke-direct {v0, p0, p0}, Lcom/nemustech/tiffany/world/TFGridHolder$GridMoveAnimation;-><init>(Lcom/nemustech/tiffany/world/TFGridHolder;Lcom/nemustech/tiffany/world/TFGridHolder;)V

    iput-object v0, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mMoveAni:Lcom/nemustech/tiffany/world/TFHolder$MoveAnimation;

    .line 12
    const/4 v0, 0x1

    iput v0, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mGroupSize:I

    .line 13
    iput v2, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mMarginLeft:F

    .line 14
    iput v2, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mMarginRight:F

    .line 15
    iput v1, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mMarginTop:F

    .line 16
    iput v1, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mMarginBottom:F

    .line 17
    iput v3, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mGroupHeight:F

    .line 18
    iput v1, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mGroupSpace:F

    .line 19
    iput v3, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mItemWidth:F

    .line 20
    const v0, 0x3e4ccccd

    iput v0, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mItemSpace:F

    .line 21
    return-void
.end method

.method static synthetic access$000()Ljava/lang/String;
    .locals 1

    .prologue
    .line 7
    sget-object v0, Lcom/nemustech/tiffany/world/TFGridHolder;->TAG:Ljava/lang/String;

    return-object v0
.end method


# virtual methods
.method addHolder(Lcom/nemustech/tiffany/world/TFHolder;I)Z
    .locals 11
    .parameter "holder"
    .parameter "slotIndex"

    .prologue
    const/4 v10, 0x0

    const/4 v9, 0x1

    .line 380
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFGridHolder;->isTerminalHolder()Z

    move-result v7

    if-eqz v7, :cond_0

    .line 381
    new-instance v7, Ljava/lang/IllegalArgumentException;

    const-string v8, "Tried to attach a holder to terminal holder"

    invoke-direct {v7, v8}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v7

    .line 382
    :cond_0
    iget-object v7, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v7}, Ljava/util/LinkedList;->size()I

    move-result v7

    if-le p2, v7, :cond_1

    .line 383
    new-instance v7, Ljava/lang/IllegalArgumentException;

    const-string v8, "The given slot index exceeds slot count"

    invoke-direct {v7, v8}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v7

    .line 385
    :cond_1
    iput-object p0, p1, Lcom/nemustech/tiffany/world/TFHolder;->mParentHolder:Lcom/nemustech/tiffany/world/TFHolder;

    .line 386
    iget-object v7, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    invoke-virtual {p1, v7}, Lcom/nemustech/tiffany/world/TFHolder;->associateToWorld(Lcom/nemustech/tiffany/world/TFWorld;)V

    .line 388
    new-instance v5, Lcom/nemustech/tiffany/world/TFObjectContainer;

    invoke-direct {v5, p1}, Lcom/nemustech/tiffany/world/TFObjectContainer;-><init>(Lcom/nemustech/tiffany/world/TFObject;)V

    .line 389
    .local v5, oc:Lcom/nemustech/tiffany/world/TFObjectContainer;
    iget-object v7, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mItemProvider:Lcom/nemustech/tiffany/world/TFItemProvider;

    if-nez v7, :cond_5

    .line 391
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFGridHolder;->getSlotCount()I

    move-result v7

    if-eqz v7, :cond_4

    .line 392
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFGridHolder;->getHeadItemIndex()I

    move-result v6

    .line 393
    .local v6, originalHeadItemIndex:I
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFGridHolder;->getHeadSlotIndex()I

    move-result v7

    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFGridHolder;->getHeadItemIndex()I

    move-result v8

    sub-int/2addr v7, v8

    invoke-virtual {p0, v7, v10}, Lcom/nemustech/tiffany/world/TFGridHolder;->shiftObjectsInSlots(IZ)V

    .line 394
    iget-object v7, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v7, p2, v5}, Ljava/util/LinkedList;->add(ILjava/lang/Object;)V

    .line 395
    const/4 v3, 0x0

    .line 396
    .local v3, idx:I
    iget-object v7, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v7}, Ljava/util/LinkedList;->iterator()Ljava/util/Iterator;

    move-result-object v2

    .local v2, i$:Ljava/util/Iterator;
    :goto_0
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v7

    if-eqz v7, :cond_2

    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/nemustech/tiffany/world/TFObjectContainer;

    .line 397
    .local v0, container:Lcom/nemustech/tiffany/world/TFObjectContainer;
    invoke-virtual {v0}, Lcom/nemustech/tiffany/world/TFObjectContainer;->getObject()Lcom/nemustech/tiffany/world/TFObject;

    move-result-object v7

    invoke-virtual {v7, v3}, Lcom/nemustech/tiffany/world/TFObject;->setItemIndex(I)V

    .line 398
    add-int/lit8 v3, v3, 0x1

    goto :goto_0

    .line 400
    .end local v0           #container:Lcom/nemustech/tiffany/world/TFObjectContainer;
    :cond_2
    if-lt v6, p2, :cond_3

    .line 401
    add-int/lit8 v6, v6, 0x1

    .line 403
    :cond_3
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFGridHolder;->getSlotCount()I

    move-result v7

    invoke-virtual {p0, v7}, Lcom/nemustech/tiffany/world/TFGridHolder;->getHeadSlotIndex(I)I

    move-result v7

    invoke-virtual {p0, v7}, Lcom/nemustech/tiffany/world/TFGridHolder;->setHeadSlotIndex(I)V

    .line 404
    iget-object v7, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v7}, Ljava/util/LinkedList;->size()I

    move-result v7

    sub-int/2addr v7, v9

    invoke-virtual {p0, v7}, Lcom/nemustech/tiffany/world/TFGridHolder;->setDrawOrder(I)V

    .line 405
    iget-object v7, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v7, v5}, Ljava/util/LinkedList;->indexOf(Ljava/lang/Object;)I

    move-result v7

    invoke-virtual {p0, p1, v7}, Lcom/nemustech/tiffany/world/TFGridHolder;->onAddHolder(Lcom/nemustech/tiffany/world/TFObject;I)V

    .line 406
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFGridHolder;->getHeadSlotIndex()I

    move-result v7

    sub-int v7, v6, v7

    invoke-virtual {p0, v7, v10}, Lcom/nemustech/tiffany/world/TFGridHolder;->shiftObjectsInSlots(IZ)V

    .line 430
    .end local v2           #i$:Ljava/util/Iterator;
    .end local v3           #idx:I
    .end local v6           #originalHeadItemIndex:I
    :goto_1
    iget-object v7, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mCloneList:Ljava/util/LinkedList;

    if-eqz v7, :cond_6

    .line 431
    iget-object v7, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mCloneList:Ljava/util/LinkedList;

    invoke-virtual {v7}, Ljava/util/LinkedList;->iterator()Ljava/util/Iterator;

    move-result-object v2

    .restart local v2       #i$:Ljava/util/Iterator;
    :goto_2
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v7

    if-eqz v7, :cond_6

    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Lcom/nemustech/tiffany/world/TFObject;

    .line 433
    .local v4, o:Lcom/nemustech/tiffany/world/TFObject;
    :try_start_0
    check-cast v4, Lcom/nemustech/tiffany/world/TFHolder;

    .end local v4           #o:Lcom/nemustech/tiffany/world/TFObject;
    invoke-virtual {p1}, Lcom/nemustech/tiffany/world/TFHolder;->clone()Ljava/lang/Object;

    move-result-object v7

    check-cast v7, Lcom/nemustech/tiffany/world/TFHolder;

    invoke-virtual {v4, v7, p2}, Lcom/nemustech/tiffany/world/TFHolder;->addHolder(Lcom/nemustech/tiffany/world/TFHolder;I)Z
    :try_end_0
    .catch Ljava/lang/CloneNotSupportedException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_2

    .line 434
    :catch_0
    move-exception v7

    move-object v1, v7

    .line 436
    .local v1, e:Ljava/lang/CloneNotSupportedException;
    invoke-virtual {v1}, Ljava/lang/CloneNotSupportedException;->printStackTrace()V

    goto :goto_2

    .line 409
    .end local v1           #e:Ljava/lang/CloneNotSupportedException;
    .end local v2           #i$:Ljava/util/Iterator;
    :cond_4
    iget-object v7, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v7, v5}, Ljava/util/LinkedList;->add(Ljava/lang/Object;)Z

    .line 410
    iget-object v7, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v7, v10}, Ljava/util/LinkedList;->get(I)Ljava/lang/Object;

    move-result-object v7

    check-cast v7, Lcom/nemustech/tiffany/world/TFObjectContainer;

    invoke-virtual {p0, v7, v10}, Lcom/nemustech/tiffany/world/TFGridHolder;->setItemIndexOfObjectInSlot(Lcom/nemustech/tiffany/world/TFObjectContainer;I)V

    .line 411
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFGridHolder;->getSlotCount()I

    move-result v7

    invoke-virtual {p0, v7}, Lcom/nemustech/tiffany/world/TFGridHolder;->getHeadSlotIndex(I)I

    move-result v7

    invoke-virtual {p0, v7}, Lcom/nemustech/tiffany/world/TFGridHolder;->setHeadSlotIndex(I)V

    .line 412
    iget-object v7, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v7}, Ljava/util/LinkedList;->size()I

    move-result v7

    sub-int/2addr v7, v9

    invoke-virtual {p0, v7}, Lcom/nemustech/tiffany/world/TFGridHolder;->setDrawOrder(I)V

    .line 413
    invoke-virtual {p0, p1, v10}, Lcom/nemustech/tiffany/world/TFGridHolder;->onAddHolder(Lcom/nemustech/tiffany/world/TFObject;I)V

    goto :goto_1

    .line 417
    :cond_5
    iget-object v7, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v7, v5}, Ljava/util/LinkedList;->add(Ljava/lang/Object;)Z

    .line 418
    iput-boolean v9, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mNeedToSetItem:Z

    .line 419
    iput-boolean v9, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mSetItemNow:Z

    .line 420
    iget-object v7, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v7}, Ljava/util/LinkedList;->size()I

    move-result v7

    sub-int/2addr v7, v9

    invoke-virtual {p0, v5, v7}, Lcom/nemustech/tiffany/world/TFGridHolder;->setItemIndexOfObjectInSlot(Lcom/nemustech/tiffany/world/TFObjectContainer;I)V

    .line 421
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFGridHolder;->getSlotCount()I

    move-result v7

    invoke-virtual {p0, v7}, Lcom/nemustech/tiffany/world/TFGridHolder;->getHeadSlotIndex(I)I

    move-result v7

    invoke-virtual {p0, v7}, Lcom/nemustech/tiffany/world/TFGridHolder;->setHeadSlotIndex(I)V

    .line 422
    iget-object v7, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v7}, Ljava/util/LinkedList;->size()I

    move-result v7

    sub-int/2addr v7, v9

    invoke-virtual {p0, v7}, Lcom/nemustech/tiffany/world/TFGridHolder;->setDrawOrder(I)V

    .line 423
    iget-object v7, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v7}, Ljava/util/LinkedList;->size()I

    move-result v7

    sub-int/2addr v7, v9

    invoke-virtual {p0, p1, v7}, Lcom/nemustech/tiffany/world/TFGridHolder;->onAddHolder(Lcom/nemustech/tiffany/world/TFObject;I)V

    goto/16 :goto_1

    .line 441
    :cond_6
    iget-object v7, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    if-eqz v7, :cond_7

    .line 442
    iget-object v7, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    invoke-static {}, Lcom/nemustech/tiffany/world/TFWorld;->requestRender()V

    .line 444
    :cond_7
    return v9
.end method

.method addModel(Lcom/nemustech/tiffany/world/TFModel;I)Z
    .locals 13
    .parameter "model"
    .parameter "slotIndex"

    .prologue
    const/4 v12, 0x0

    const/4 v11, 0x1

    .line 499
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFGridHolder;->isTerminalHolder()Z

    move-result v9

    if-nez v9, :cond_0

    .line 500
    new-instance v9, Ljava/lang/IllegalArgumentException;

    const-string v10, "Cannot attach a model to non terminal holder"

    invoke-direct {v9, v10}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v9

    .line 501
    :cond_0
    iget-object v9, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v9}, Ljava/util/LinkedList;->size()I

    move-result v9

    if-le p2, v9, :cond_1

    .line 502
    new-instance v9, Ljava/lang/IllegalArgumentException;

    const-string v10, "Invalid slotIndex"

    invoke-direct {v9, v10}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v9

    .line 504
    :cond_1
    iput-object p0, p1, Lcom/nemustech/tiffany/world/TFModel;->mParentHolder:Lcom/nemustech/tiffany/world/TFHolder;

    .line 505
    iget-object v9, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    iput-object v9, p1, Lcom/nemustech/tiffany/world/TFModel;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    .line 507
    new-instance v7, Lcom/nemustech/tiffany/world/TFObjectContainer;

    invoke-direct {v7, p1}, Lcom/nemustech/tiffany/world/TFObjectContainer;-><init>(Lcom/nemustech/tiffany/world/TFObject;)V

    .line 508
    .local v7, oc:Lcom/nemustech/tiffany/world/TFObjectContainer;
    iget-object v9, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mImageProvider:Lcom/nemustech/tiffany/world/TFHolder$ImageProvider;

    if-nez v9, :cond_5

    iget-object v9, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mItemProvider:Lcom/nemustech/tiffany/world/TFItemProvider;

    if-nez v9, :cond_5

    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFGridHolder;->getHeadSlotIndex()I

    move-result v9

    if-ltz v9, :cond_5

    .line 510
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFGridHolder;->getSlotCount()I

    move-result v9

    if-eqz v9, :cond_4

    .line 511
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFGridHolder;->getHeadItemIndex()I

    move-result v8

    .line 512
    .local v8, originalHeadItemIndex:I
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFGridHolder;->getHeadSlotIndex()I

    move-result v9

    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFGridHolder;->getHeadItemIndex()I

    move-result v10

    sub-int/2addr v9, v10

    invoke-virtual {p0, v9, v12}, Lcom/nemustech/tiffany/world/TFGridHolder;->shiftObjectsInSlots(IZ)V

    .line 513
    iget-object v9, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v9, p2, v7}, Ljava/util/LinkedList;->add(ILjava/lang/Object;)V

    .line 515
    const/4 v5, 0x0

    .line 516
    .local v5, idx:I
    iget-object v9, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v9}, Ljava/util/LinkedList;->iterator()Ljava/util/Iterator;

    move-result-object v4

    .local v4, i$:Ljava/util/Iterator;
    :goto_0
    invoke-interface {v4}, Ljava/util/Iterator;->hasNext()Z

    move-result v9

    if-eqz v9, :cond_2

    invoke-interface {v4}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/nemustech/tiffany/world/TFObjectContainer;

    .line 517
    .local v1, container:Lcom/nemustech/tiffany/world/TFObjectContainer;
    invoke-virtual {v1}, Lcom/nemustech/tiffany/world/TFObjectContainer;->getObject()Lcom/nemustech/tiffany/world/TFObject;

    move-result-object v9

    invoke-virtual {v9, v5}, Lcom/nemustech/tiffany/world/TFObject;->setItemIndex(I)V

    .line 518
    add-int/lit8 v5, v5, 0x1

    goto :goto_0

    .line 521
    .end local v1           #container:Lcom/nemustech/tiffany/world/TFObjectContainer;
    :cond_2
    if-lt v8, p2, :cond_3

    .line 522
    add-int/lit8 v8, v8, 0x1

    .line 524
    :cond_3
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFGridHolder;->getSlotCount()I

    move-result v9

    invoke-virtual {p0, v9}, Lcom/nemustech/tiffany/world/TFGridHolder;->getHeadSlotIndex(I)I

    move-result v9

    invoke-virtual {p0, v9}, Lcom/nemustech/tiffany/world/TFGridHolder;->setHeadSlotIndex(I)V

    .line 525
    iget-object v9, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v9}, Ljava/util/LinkedList;->size()I

    move-result v9

    sub-int/2addr v9, v11

    invoke-virtual {p0, v9}, Lcom/nemustech/tiffany/world/TFGridHolder;->setDrawOrder(I)V

    .line 526
    invoke-virtual {p0, p1, p2}, Lcom/nemustech/tiffany/world/TFGridHolder;->onAddModel(Lcom/nemustech/tiffany/world/TFObject;I)V

    .line 527
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFGridHolder;->getHeadSlotIndex()I

    move-result v9

    sub-int v9, v8, v9

    invoke-virtual {p0, v9, v12}, Lcom/nemustech/tiffany/world/TFGridHolder;->shiftObjectsInSlots(IZ)V

    .line 551
    .end local v4           #i$:Ljava/util/Iterator;
    .end local v5           #idx:I
    .end local v8           #originalHeadItemIndex:I
    :goto_1
    iget-object v9, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mCloneList:Ljava/util/LinkedList;

    if-eqz v9, :cond_6

    .line 552
    iget-object v9, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mCloneList:Ljava/util/LinkedList;

    invoke-virtual {v9}, Ljava/util/LinkedList;->iterator()Ljava/util/Iterator;

    move-result-object v4

    .restart local v4       #i$:Ljava/util/Iterator;
    :goto_2
    invoke-interface {v4}, Ljava/util/Iterator;->hasNext()Z

    move-result v9

    if-eqz v9, :cond_6

    invoke-interface {v4}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v6

    check-cast v6, Lcom/nemustech/tiffany/world/TFObject;

    .line 554
    .local v6, o:Lcom/nemustech/tiffany/world/TFObject;
    :try_start_0
    move-object v0, v6

    check-cast v0, Lcom/nemustech/tiffany/world/TFHolder;

    move-object v3, v0

    .line 555
    .local v3, h:Lcom/nemustech/tiffany/world/TFHolder;
    invoke-virtual {p1}, Lcom/nemustech/tiffany/world/TFModel;->clone()Ljava/lang/Object;

    move-result-object v9

    check-cast v9, Lcom/nemustech/tiffany/world/TFModel;

    invoke-virtual {v3, v9, p2}, Lcom/nemustech/tiffany/world/TFHolder;->addModel(Lcom/nemustech/tiffany/world/TFModel;I)Z
    :try_end_0
    .catch Ljava/lang/CloneNotSupportedException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_2

    .line 556
    .end local v3           #h:Lcom/nemustech/tiffany/world/TFHolder;
    :catch_0
    move-exception v9

    move-object v2, v9

    .line 558
    .local v2, e:Ljava/lang/CloneNotSupportedException;
    invoke-virtual {v2}, Ljava/lang/CloneNotSupportedException;->printStackTrace()V

    goto :goto_2

    .line 530
    .end local v2           #e:Ljava/lang/CloneNotSupportedException;
    .end local v4           #i$:Ljava/util/Iterator;
    .end local v6           #o:Lcom/nemustech/tiffany/world/TFObject;
    :cond_4
    iget-object v9, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v9, v7}, Ljava/util/LinkedList;->add(Ljava/lang/Object;)Z

    .line 531
    iget-object v9, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v9, v12}, Ljava/util/LinkedList;->get(I)Ljava/lang/Object;

    move-result-object v9

    check-cast v9, Lcom/nemustech/tiffany/world/TFObjectContainer;

    invoke-virtual {p0, v9, v12}, Lcom/nemustech/tiffany/world/TFGridHolder;->setItemIndexOfObjectInSlot(Lcom/nemustech/tiffany/world/TFObjectContainer;I)V

    .line 532
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFGridHolder;->getSlotCount()I

    move-result v9

    invoke-virtual {p0, v9}, Lcom/nemustech/tiffany/world/TFGridHolder;->getHeadSlotIndex(I)I

    move-result v9

    invoke-virtual {p0, v9}, Lcom/nemustech/tiffany/world/TFGridHolder;->setHeadSlotIndex(I)V

    .line 533
    iget-object v9, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v9}, Ljava/util/LinkedList;->size()I

    move-result v9

    sub-int/2addr v9, v11

    invoke-virtual {p0, v9}, Lcom/nemustech/tiffany/world/TFGridHolder;->setDrawOrder(I)V

    .line 534
    invoke-virtual {p0, p1, v12}, Lcom/nemustech/tiffany/world/TFGridHolder;->onAddModel(Lcom/nemustech/tiffany/world/TFObject;I)V

    goto :goto_1

    .line 538
    :cond_5
    iget-object v9, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v9, v7}, Ljava/util/LinkedList;->add(Ljava/lang/Object;)Z

    .line 539
    iput-boolean v11, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mNeedToSetItem:Z

    .line 540
    iput-boolean v11, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mSetItemNow:Z

    .line 541
    iget-object v9, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v9}, Ljava/util/LinkedList;->size()I

    move-result v9

    sub-int/2addr v9, v11

    invoke-virtual {p0, v7, v9}, Lcom/nemustech/tiffany/world/TFGridHolder;->setItemIndexOfObjectInSlot(Lcom/nemustech/tiffany/world/TFObjectContainer;I)V

    .line 542
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFGridHolder;->getSlotCount()I

    move-result v9

    invoke-virtual {p0, v9}, Lcom/nemustech/tiffany/world/TFGridHolder;->getHeadSlotIndex(I)I

    move-result v9

    invoke-virtual {p0, v9}, Lcom/nemustech/tiffany/world/TFGridHolder;->setHeadSlotIndex(I)V

    .line 543
    iget-object v9, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v9}, Ljava/util/LinkedList;->size()I

    move-result v9

    sub-int/2addr v9, v11

    invoke-virtual {p0, v9}, Lcom/nemustech/tiffany/world/TFGridHolder;->setDrawOrder(I)V

    .line 544
    iget-object v9, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v9}, Ljava/util/LinkedList;->size()I

    move-result v9

    sub-int/2addr v9, v11

    invoke-virtual {p0, p1, v9}, Lcom/nemustech/tiffany/world/TFGridHolder;->onAddModel(Lcom/nemustech/tiffany/world/TFObject;I)V

    goto/16 :goto_1

    .line 563
    :cond_6
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFGridHolder;->requestLayout()V

    .line 564
    return v11
.end method

.method public calcGroupCount(I)I
    .locals 2
    .parameter "itemCount"

    .prologue
    const/4 v1, 0x1

    .line 38
    iget v0, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mGroupSize:I

    if-ne v0, v1, :cond_0

    move v0, p1

    .line 40
    :goto_0
    return v0

    :cond_0
    iget v0, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mGroupSize:I

    add-int/2addr v0, p1

    sub-int/2addr v0, v1

    iget v1, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mGroupSize:I

    div-int/2addr v0, v1

    goto :goto_0
.end method

.method public getGroupCount()I
    .locals 1

    .prologue
    .line 34
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFGridHolder;->getItemCount()I

    move-result v0

    invoke-virtual {p0, v0}, Lcom/nemustech/tiffany/world/TFGridHolder;->calcGroupCount(I)I

    move-result v0

    return v0
.end method

.method protected getGroupPosition(I)F
    .locals 3
    .parameter "group"

    .prologue
    .line 79
    const/4 v0, 0x0

    .line 80
    .local v0, p:F
    iget v1, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mMarginTop:F

    add-float/2addr v0, v1

    .line 81
    iget v1, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mGroupHeight:F

    iget v2, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mGroupSpace:F

    add-float/2addr v1, v2

    int-to-float v2, p1

    mul-float/2addr v1, v2

    add-float/2addr v0, v1

    .line 82
    iget v1, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mGroupHeight:F

    const/high16 v2, 0x4000

    div-float/2addr v1, v2

    add-float/2addr v0, v1

    .line 83
    return v0
.end method

.method public getGroupSize()I
    .locals 1

    .prologue
    .line 30
    iget v0, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mGroupSize:I

    return v0
.end method

.method protected getGroupSpace(I)F
    .locals 4
    .parameter "groupCount"

    .prologue
    .line 64
    const/4 v0, 0x0

    .line 65
    .local v0, p:F
    iget v0, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mViewHeight:F

    .line 66
    iget v1, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mMarginTop:F

    iget v2, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mMarginBottom:F

    add-float/2addr v1, v2

    iget v2, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mGroupHeight:F

    int-to-float v3, p1

    mul-float/2addr v2, v3

    add-float/2addr v1, v2

    sub-float/2addr v0, v1

    .line 67
    const/4 v1, 0x1

    sub-int v1, p1, v1

    int-to-float v1, v1

    div-float/2addr v0, v1

    .line 68
    return v0
.end method

.method protected getItemPosition(I)F
    .locals 3
    .parameter "itemInGroup"

    .prologue
    .line 87
    const/4 v0, 0x0

    .line 88
    .local v0, p:F
    iget v1, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mMarginLeft:F

    add-float/2addr v0, v1

    .line 89
    iget v1, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mItemWidth:F

    iget v2, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mItemSpace:F

    add-float/2addr v1, v2

    int-to-float v2, p1

    mul-float/2addr v1, v2

    add-float/2addr v0, v1

    .line 90
    iget v1, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mItemWidth:F

    const/high16 v2, 0x4000

    div-float/2addr v1, v2

    add-float/2addr v0, v1

    .line 91
    return v0
.end method

.method protected getItemSpace(I)F
    .locals 4
    .parameter "groupSize"

    .prologue
    .line 71
    const/4 v0, 0x0

    .line 72
    .local v0, p:F
    iget v0, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mViewWidth:F

    .line 73
    iget v1, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mMarginLeft:F

    iget v2, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mMarginRight:F

    add-float/2addr v1, v2

    iget v2, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mItemWidth:F

    int-to-float v3, p1

    mul-float/2addr v2, v3

    add-float/2addr v1, v2

    sub-float/2addr v0, v1

    .line 74
    const/4 v1, 0x1

    sub-int v1, p1, v1

    int-to-float v1, v1

    div-float/2addr v0, v1

    .line 75
    return v0
.end method

.method public getMoveAnimation()Lcom/nemustech/tiffany/world/TFGridHolder$GridMoveAnimation;
    .locals 0

    .prologue
    .line 95
    iget-object p0, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mMoveAni:Lcom/nemustech/tiffany/world/TFHolder$MoveAnimation;

    .end local p0
    check-cast p0, Lcom/nemustech/tiffany/world/TFGridHolder$GridMoveAnimation;

    return-object p0
.end method

.method public bridge synthetic getMoveAnimation()Lcom/nemustech/tiffany/world/TFHolder$MoveAnimation;
    .locals 1

    .prologue
    .line 7
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFGridHolder;->getMoveAnimation()Lcom/nemustech/tiffany/world/TFGridHolder$GridMoveAnimation;

    move-result-object v0

    return-object v0
.end method

.method protected getViewHeight(I)F
    .locals 3
    .parameter "groupCount"

    .prologue
    .line 50
    const/4 v0, 0x0

    .line 51
    .local v0, p:F
    iget v1, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mMarginTop:F

    add-float/2addr v0, v1

    .line 52
    iget v1, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mGroupHeight:F

    iget v2, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mGroupSpace:F

    add-float/2addr v1, v2

    int-to-float v2, p1

    mul-float/2addr v1, v2

    iget v2, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mGroupSpace:F

    sub-float/2addr v1, v2

    add-float/2addr v0, v1

    .line 53
    iget v1, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mMarginBottom:F

    add-float/2addr v0, v1

    .line 54
    return v0
.end method

.method protected getViewWidth(I)F
    .locals 3
    .parameter "groupSize"

    .prologue
    .line 57
    const/4 v0, 0x0

    .line 58
    .local v0, p:F
    iget v1, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mMarginLeft:F

    add-float/2addr v0, v1

    .line 59
    iget v1, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mItemWidth:F

    iget v2, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mItemSpace:F

    add-float/2addr v1, v2

    int-to-float v2, p1

    mul-float/2addr v1, v2

    iget v2, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mItemSpace:F

    sub-float/2addr v1, v2

    add-float/2addr v0, v1

    .line 60
    iget v1, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mMarginRight:F

    add-float/2addr v0, v1

    .line 61
    return v0
.end method

.method protected indexToGroup(I)I
    .locals 2
    .parameter "index"

    .prologue
    .line 44
    iget v0, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mGroupSize:I

    const/4 v1, 0x1

    if-ne v0, v1, :cond_0

    move v0, p1

    .line 46
    :goto_0
    return v0

    :cond_0
    iget v0, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mGroupSize:I

    div-int v0, p1, v0

    goto :goto_0
.end method

.method public layoutObjects(F)V
    .locals 20
    .parameter "headDeviation"

    .prologue
    .line 193
    invoke-virtual/range {p0 .. p0}, Lcom/nemustech/tiffany/world/TFGridHolder;->getItemCount()I

    move-result v11

    .line 194
    .local v11, itemCount:I
    move-object/from16 v0, p0

    move v1, v11

    invoke-virtual {v0, v1}, Lcom/nemustech/tiffany/world/TFGridHolder;->indexToGroup(I)I

    move-result v12

    .line 195
    .local v12, itemGroupCount:I
    invoke-virtual/range {p0 .. p0}, Lcom/nemustech/tiffany/world/TFGridHolder;->getSlotCount()I

    move-result v15

    .line 196
    .local v15, modelCount:I
    move-object/from16 v0, p0

    move v1, v15

    invoke-virtual {v0, v1}, Lcom/nemustech/tiffany/world/TFGridHolder;->calcGroupCount(I)I

    move-result v16

    .line 197
    .local v16, modelGroupCount:I
    move/from16 v0, p1

    float-to-int v0, v0

    move v2, v0

    int-to-float v2, v2

    sub-float v19, p1, v2

    .line 200
    .local v19, t:F
    const/4 v7, 0x0

    .line 202
    .local v7, z:F
    move-object/from16 v0, p0

    move v1, v12

    invoke-virtual {v0, v1}, Lcom/nemustech/tiffany/world/TFGridHolder;->getViewHeight(I)F

    move-result v2

    move v0, v2

    move-object/from16 v1, p0

    iput v0, v1, Lcom/nemustech/tiffany/world/TFGridHolder;->mViewHeight:F

    .line 203
    move-object/from16 v0, p0

    iget v0, v0, Lcom/nemustech/tiffany/world/TFGridHolder;->mGroupSize:I

    move v2, v0

    move-object/from16 v0, p0

    move v1, v2

    invoke-virtual {v0, v1}, Lcom/nemustech/tiffany/world/TFGridHolder;->getViewWidth(I)F

    move-result v2

    move v0, v2

    move-object/from16 v1, p0

    iput v0, v1, Lcom/nemustech/tiffany/world/TFGridHolder;->mViewWidth:F

    .line 205
    move-object/from16 v0, p0

    iget v0, v0, Lcom/nemustech/tiffany/world/TFGridHolder;->mHeadItemIndex:I

    move v2, v0

    move-object/from16 v0, p0

    move v1, v2

    invoke-virtual {v0, v1}, Lcom/nemustech/tiffany/world/TFGridHolder;->indexToGroup(I)I

    move-result v2

    move-object/from16 v0, p0

    move v1, v2

    invoke-virtual {v0, v1}, Lcom/nemustech/tiffany/world/TFGridHolder;->getGroupPosition(I)F

    move-result v9

    .line 208
    .local v9, headY:F
    const/4 v14, 0x0

    .local v14, j:I
    :goto_0
    move v0, v14

    move/from16 v1, v16

    if-ge v0, v1, :cond_3

    .line 209
    move-object/from16 v0, p0

    iget v0, v0, Lcom/nemustech/tiffany/world/TFGridHolder;->mGroupSize:I

    move v2, v0

    mul-int v4, v14, v2

    .line 210
    .local v4, modelIndex:I
    move-object/from16 v0, p0

    iget v0, v0, Lcom/nemustech/tiffany/world/TFGridHolder;->mHeadItemIndex:I

    move v2, v0

    invoke-virtual/range {p0 .. p0}, Lcom/nemustech/tiffany/world/TFGridHolder;->getHeadSlotIndex()I

    move-result v3

    sub-int v3, v4, v3

    add-int v13, v2, v3

    .line 211
    .local v13, itemIndex:I
    move-object/from16 v0, p0

    move v1, v13

    invoke-virtual {v0, v1}, Lcom/nemustech/tiffany/world/TFGridHolder;->indexToGroup(I)I

    move-result v8

    .line 214
    .local v8, group:I
    const/4 v2, 0x0

    cmpg-float v2, p1, v2

    if-gez v2, :cond_1

    .line 215
    move-object/from16 v0, p0

    move v1, v8

    invoke-virtual {v0, v1}, Lcom/nemustech/tiffany/world/TFGridHolder;->getGroupPosition(I)F

    move-result v17

    .line 216
    .local v17, p1:F
    add-int/lit8 v2, v8, 0x1

    move-object/from16 v0, p0

    move v1, v2

    invoke-virtual {v0, v1}, Lcom/nemustech/tiffany/world/TFGridHolder;->getGroupPosition(I)F

    move-result v18

    .line 217
    .local v18, p2:F
    const/high16 v2, 0x3f80

    move/from16 v0, v19

    neg-float v0, v0

    move v3, v0

    sub-float/2addr v2, v3

    mul-float v2, v2, v17

    move/from16 v0, v19

    neg-float v0, v0

    move v3, v0

    mul-float v3, v3, v18

    add-float v6, v2, v3

    .line 224
    .local v6, y:F
    :goto_1
    sub-float/2addr v6, v9

    .line 226
    const/4 v10, 0x0

    .local v10, i:I
    :goto_2
    move-object/from16 v0, p0

    iget v0, v0, Lcom/nemustech/tiffany/world/TFGridHolder;->mGroupSize:I

    move v2, v0

    if-ge v10, v2, :cond_0

    .line 227
    if-lt v4, v15, :cond_2

    .line 208
    :cond_0
    add-int/lit8 v14, v14, 0x1

    goto :goto_0

    .line 220
    .end local v6           #y:F
    .end local v10           #i:I
    .end local v17           #p1:F
    .end local v18           #p2:F
    :cond_1
    move-object/from16 v0, p0

    move v1, v8

    invoke-virtual {v0, v1}, Lcom/nemustech/tiffany/world/TFGridHolder;->getGroupPosition(I)F

    move-result v17

    .line 221
    .restart local v17       #p1:F
    const/4 v2, 0x1

    sub-int v2, v8, v2

    move-object/from16 v0, p0

    move v1, v2

    invoke-virtual {v0, v1}, Lcom/nemustech/tiffany/world/TFGridHolder;->getGroupPosition(I)F

    move-result v18

    .line 222
    .restart local v18       #p2:F
    const/high16 v2, 0x3f80

    sub-float v2, v2, v19

    mul-float v2, v2, v17

    mul-float v3, v19, v18

    add-float v6, v2, v3

    .restart local v6       #y:F
    goto :goto_1

    .line 230
    .restart local v10       #i:I
    :cond_2
    move-object/from16 v0, p0

    move v1, v4

    invoke-virtual {v0, v1}, Lcom/nemustech/tiffany/world/TFGridHolder;->getModelInSlot(I)Lcom/nemustech/tiffany/world/TFModel;

    move-result-object v3

    .line 231
    .local v3, model:Lcom/nemustech/tiffany/world/TFModel;
    move-object/from16 v0, p0

    move v1, v10

    invoke-virtual {v0, v1}, Lcom/nemustech/tiffany/world/TFGridHolder;->getItemPosition(I)F

    move-result v5

    .local v5, x:F
    move-object/from16 v2, p0

    .line 232
    invoke-virtual/range {v2 .. v7}, Lcom/nemustech/tiffany/world/TFGridHolder;->locateModel(Lcom/nemustech/tiffany/world/TFModel;IFFF)V

    .line 234
    add-int/lit8 v4, v4, 0x1

    .line 226
    add-int/lit8 v10, v10, 0x1

    goto :goto_2

    .line 237
    .end local v3           #model:Lcom/nemustech/tiffany/world/TFModel;
    .end local v4           #modelIndex:I
    .end local v5           #x:F
    .end local v6           #y:F
    .end local v8           #group:I
    .end local v10           #i:I
    .end local v13           #itemIndex:I
    .end local v17           #p1:F
    .end local v18           #p2:F
    :cond_3
    return-void
.end method

.method protected abstract locateModel(Lcom/nemustech/tiffany/world/TFModel;IFFF)V
.end method

.method public moveHeadModelStep(FZ)Z
    .locals 9
    .parameter "step"
    .parameter "bindingAction"

    .prologue
    const/4 v8, 0x1

    const/4 v7, 0x0

    .line 338
    iget v5, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mDeviation:F

    add-float/2addr p1, v5

    .line 339
    invoke-virtual {p0, p1}, Lcom/nemustech/tiffany/world/TFGridHolder;->getDeviation(F)F

    move-result v1

    .line 340
    .local v1, deviation:F
    invoke-virtual {p0, p1}, Lcom/nemustech/tiffany/world/TFGridHolder;->getOffset(F)I

    move-result v4

    .line 342
    .local v4, offset:I
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFGridHolder;->getHeadItemIndex()I

    move-result v5

    invoke-virtual {p0, v5}, Lcom/nemustech/tiffany/world/TFGridHolder;->indexToGroup(I)I

    move-result v2

    .line 343
    .local v2, head:I
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFGridHolder;->getGroupCount()I

    move-result v0

    .line 345
    .local v0, count:I
    iget-boolean v5, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mWraparound:Z

    if-nez v5, :cond_1

    add-int v5, v2, v4

    if-ge v5, v0, :cond_0

    add-int v5, v2, v4

    if-gez v5, :cond_1

    :cond_0
    move v5, v7

    .line 365
    :goto_0
    return v5

    .line 348
    :cond_1
    iget v5, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mGroupSize:I

    mul-int/2addr v5, v4

    invoke-virtual {p0, v5, v8}, Lcom/nemustech/tiffany/world/TFGridHolder;->scrollHeadItemIndex(IZ)I

    move-result v3

    .line 349
    .local v3, moved:I
    iget v5, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mGroupSize:I

    mul-int/2addr v5, v4

    if-ne v5, v3, :cond_3

    .line 350
    iput v1, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mDeviation:F

    .line 357
    :goto_1
    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mHolderBindings:Ljava/util/LinkedList;

    invoke-virtual {v5}, Ljava/util/LinkedList;->isEmpty()Z

    move-result v5

    if-nez v5, :cond_2

    if-eqz p2, :cond_2

    .line 358
    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mBindingBehaviorDispatcher:Lcom/nemustech/tiffany/world/TFHolder$BindingBehaviorDispatcher;

    if-eqz v5, :cond_4

    .line 359
    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mBindingBehaviorDispatcher:Lcom/nemustech/tiffany/world/TFHolder$BindingBehaviorDispatcher;

    invoke-interface {v5, p1}, Lcom/nemustech/tiffany/world/TFHolder$BindingBehaviorDispatcher;->bindingBehavior(F)V

    .line 364
    :cond_2
    :goto_2
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFGridHolder;->requestLayout()V

    .line 365
    iget v5, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mGroupSize:I

    mul-int/2addr v5, v4

    if-ne v5, v3, :cond_5

    move v5, v8

    goto :goto_0

    .line 353
    :cond_3
    const v5, 0x3ee66666

    mul-float/2addr v5, p1

    invoke-static {p1}, Ljava/lang/Math;->abs(F)F

    move-result v6

    div-float/2addr v5, v6

    iput v5, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mDeviation:F

    goto :goto_1

    .line 360
    :cond_4
    invoke-virtual {p0, p1}, Lcom/nemustech/tiffany/world/TFGridHolder;->defaultBindingBehavior(F)V

    goto :goto_2

    :cond_5
    move v5, v7

    .line 365
    goto :goto_0
.end method

.method removeHolder(IZ)Lcom/nemustech/tiffany/world/TFHolder;
    .locals 8
    .parameter "slotIndex"
    .parameter "showAnimation"

    .prologue
    const/4 v6, 0x0

    const/4 v7, 0x0

    .line 449
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFGridHolder;->isTerminalHolder()Z

    move-result v5

    if-eqz v5, :cond_0

    move-object v5, v6

    .line 494
    :goto_0
    return-object v5

    .line 451
    :cond_0
    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v5}, Ljava/util/LinkedList;->size()I

    move-result v5

    if-lt p1, v5, :cond_1

    move-object v5, v6

    .line 452
    goto :goto_0

    .line 454
    :cond_1
    const/4 v0, 0x0

    .line 455
    .local v0, holder:Lcom/nemustech/tiffany/world/TFHolder;
    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mImageProvider:Lcom/nemustech/tiffany/world/TFHolder$ImageProvider;

    if-nez v5, :cond_4

    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mItemProvider:Lcom/nemustech/tiffany/world/TFItemProvider;

    if-nez v5, :cond_4

    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFGridHolder;->getHeadSlotIndex()I

    move-result v5

    if-ltz v5, :cond_4

    .line 457
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFGridHolder;->getSlotCount()I

    move-result v5

    if-eqz v5, :cond_3

    .line 458
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFGridHolder;->getHeadItemIndex()I

    move-result v4

    .line 459
    .local v4, originalHeadItemIndex:I
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFGridHolder;->getHeadSlotIndex()I

    move-result v5

    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFGridHolder;->getHeadItemIndex()I

    move-result v6

    sub-int/2addr v5, v6

    invoke-virtual {p0, v5, v7}, Lcom/nemustech/tiffany/world/TFGridHolder;->shiftObjectsInSlots(IZ)V

    .line 460
    invoke-virtual {p0, p1}, Lcom/nemustech/tiffany/world/TFGridHolder;->getHolderInSlot(I)Lcom/nemustech/tiffany/world/TFHolder;

    move-result-object v0

    .line 461
    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v5, p1}, Ljava/util/LinkedList;->remove(I)Ljava/lang/Object;

    .line 462
    move v1, p1

    .local v1, i:I
    :goto_1
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFGridHolder;->getSlotCount()I

    move-result v5

    if-ge v1, v5, :cond_2

    .line 463
    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v5, v1}, Ljava/util/LinkedList;->get(I)Ljava/lang/Object;

    move-result-object v5

    check-cast v5, Lcom/nemustech/tiffany/world/TFObjectContainer;

    invoke-virtual {v5}, Lcom/nemustech/tiffany/world/TFObjectContainer;->getObject()Lcom/nemustech/tiffany/world/TFObject;

    move-result-object v5

    invoke-virtual {v5, v1}, Lcom/nemustech/tiffany/world/TFObject;->setItemIndex(I)V

    .line 462
    add-int/lit8 v1, v1, 0x1

    goto :goto_1

    .line 465
    :cond_2
    invoke-virtual {p0, p1}, Lcom/nemustech/tiffany/world/TFGridHolder;->setDrawOrder(I)V

    .line 466
    invoke-virtual {p0, v0, p1}, Lcom/nemustech/tiffany/world/TFGridHolder;->onRemoveHolder(Lcom/nemustech/tiffany/world/TFObject;I)V

    .line 467
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFGridHolder;->getHeadSlotIndex()I

    move-result v5

    sub-int v5, v4, v5

    invoke-virtual {p0, v5, v7}, Lcom/nemustech/tiffany/world/TFGridHolder;->shiftObjectsInSlots(IZ)V

    .line 487
    .end local v1           #i:I
    .end local v4           #originalHeadItemIndex:I
    :goto_2
    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mCloneList:Ljava/util/LinkedList;

    if-eqz v5, :cond_5

    .line 488
    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mCloneList:Ljava/util/LinkedList;

    invoke-virtual {v5}, Ljava/util/LinkedList;->iterator()Ljava/util/Iterator;

    move-result-object v2

    .local v2, i$:Ljava/util/Iterator;
    :goto_3
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v5

    if-eqz v5, :cond_5

    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Lcom/nemustech/tiffany/world/TFObject;

    .line 489
    .local v3, o:Lcom/nemustech/tiffany/world/TFObject;
    check-cast v3, Lcom/nemustech/tiffany/world/TFHolder;

    .end local v3           #o:Lcom/nemustech/tiffany/world/TFObject;
    invoke-virtual {v3, p1}, Lcom/nemustech/tiffany/world/TFHolder;->removeHolder(I)Lcom/nemustech/tiffany/world/TFHolder;

    goto :goto_3

    .line 470
    .end local v2           #i$:Ljava/util/Iterator;
    :cond_3
    new-instance v5, Ljava/lang/IllegalArgumentException;

    const-string v6, "Nothing to remove"

    invoke-direct {v5, v6}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v5

    .line 474
    :cond_4
    invoke-virtual {p0, p1}, Lcom/nemustech/tiffany/world/TFGridHolder;->getHolderInSlot(I)Lcom/nemustech/tiffany/world/TFHolder;

    move-result-object v0

    .line 475
    invoke-virtual {p0, v0, p1}, Lcom/nemustech/tiffany/world/TFGridHolder;->onRemoveHolder(Lcom/nemustech/tiffany/world/TFObject;I)V

    .line 476
    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v5, p1}, Ljava/util/LinkedList;->remove(I)Ljava/lang/Object;

    .line 477
    invoke-virtual {p0, p1}, Lcom/nemustech/tiffany/world/TFGridHolder;->setDrawOrder(I)V

    goto :goto_2

    .line 493
    :cond_5
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFGridHolder;->requestLayout()V

    move-object v5, v0

    .line 494
    goto/16 :goto_0
.end method

.method removeModel(IZ)Lcom/nemustech/tiffany/world/TFModel;
    .locals 1
    .parameter "index"
    .parameter "showAnimation"

    .prologue
    .line 570
    const/4 v0, 0x0

    return-object v0
.end method

.method public scrollHeadItemIndex(IZ)I
    .locals 9
    .parameter "offset"
    .parameter "callListener"

    .prologue
    const/4 v8, 0x1

    .line 244
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFGridHolder;->getItemCount()I

    move-result v2

    .line 245
    .local v2, itemCount:I
    iget v0, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mHeadItemIndex:I

    .line 246
    .local v0, headIndex:I
    const/4 v3, 0x0

    .line 248
    .local v3, itemIndexLimit:I
    if-gez p1, :cond_1

    .line 250
    iget v5, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mScrollStartIndexOffset:I

    neg-int v5, v5

    iget v6, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mGroupSize:I

    mul-int v3, v5, v6

    .line 252
    const/4 v1, 0x0

    .local v1, i:I
    :goto_0
    neg-int v5, p1

    if-ge v1, v5, :cond_4

    .line 253
    add-int/lit8 v0, v0, -0x1

    invoke-virtual {p0, v0}, Lcom/nemustech/tiffany/world/TFGridHolder;->adjustItemIndex(I)I

    move-result v4

    .line 254
    .local v4, newIndex:I
    if-ge v4, v3, :cond_0

    .line 255
    neg-int v5, v1

    .line 278
    .end local v4           #newIndex:I
    :goto_1
    return v5

    .line 257
    .restart local v4       #newIndex:I
    :cond_0
    iput v4, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mHeadItemIndex:I

    .line 258
    const/4 v5, -0x1

    invoke-virtual {p0, v5, v8}, Lcom/nemustech/tiffany/world/TFGridHolder;->shiftObjectsInSlots(IZ)V

    .line 252
    add-int/lit8 v1, v1, 0x1

    goto :goto_0

    .line 265
    .end local v1           #i:I
    .end local v4           #newIndex:I
    :cond_1
    iget v5, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mScrollEndIndexOffset:I

    add-int/lit8 v5, v5, 0x1

    iget v6, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mGroupSize:I

    mul-int/2addr v5, v6

    sub-int v3, v2, v5

    .line 266
    sget-object v5, Lcom/nemustech/tiffany/world/TFGridHolder;->TAG:Ljava/lang/String;

    new-instance v6, Ljava/lang/StringBuilder;

    invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V

    const-string v7, "item index limit is: "

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6, v3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v6

    const-string v7, "/"

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-static {v5, v6}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 267
    const/4 v1, 0x0

    .restart local v1       #i:I
    :goto_2
    if-ge v1, p1, :cond_4

    .line 268
    add-int/lit8 v0, v0, 0x1

    invoke-virtual {p0, v0}, Lcom/nemustech/tiffany/world/TFGridHolder;->adjustItemIndex(I)I

    move-result v4

    .line 269
    .restart local v4       #newIndex:I
    if-ltz v4, :cond_2

    if-le v4, v3, :cond_3

    :cond_2
    move v5, v1

    .line 270
    goto :goto_1

    .line 272
    :cond_3
    iput v4, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mHeadItemIndex:I

    .line 273
    invoke-virtual {p0, v8, v8}, Lcom/nemustech/tiffany/world/TFGridHolder;->shiftObjectsInSlots(IZ)V

    .line 267
    add-int/lit8 v1, v1, 0x1

    goto :goto_2

    .end local v4           #newIndex:I
    :cond_4
    move v5, p1

    .line 278
    goto :goto_1
.end method

.method public scrollHeadModelIndex(I)I
    .locals 1
    .parameter "offset"

    .prologue
    .line 283
    const/4 v0, 0x0

    return v0
.end method

.method public setEndlessMode(Z)V
    .locals 2
    .parameter "endless"

    .prologue
    .line 132
    sget-object v0, Lcom/nemustech/tiffany/world/TFGridHolder;->TAG:Ljava/lang/String;

    const-string v1, "Endless mode is not supported"

    invoke-static {v0, v1}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I

    .line 133
    const/4 v0, 0x0

    invoke-super {p0, v0}, Lcom/nemustech/tiffany/world/TFHolder;->setEndlessMode(Z)V

    .line 134
    return-void
.end method

.method public setGroupSize(I)V
    .locals 1
    .parameter "groupSize"

    .prologue
    .line 24
    const/4 v0, 0x1

    if-ge p1, v0, :cond_0

    .line 28
    :goto_0
    return-void

    .line 27
    :cond_0
    iput p1, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mGroupSize:I

    goto :goto_0
.end method

.method public setHeadGroupIndex(IZ)V
    .locals 2
    .parameter "groupIndex"
    .parameter "showAnimation"

    .prologue
    .line 99
    iget v1, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mHeadItemIndex:I

    invoke-virtual {p0, v1}, Lcom/nemustech/tiffany/world/TFGridHolder;->indexToGroup(I)I

    move-result v1

    sub-int v0, p1, v1

    .line 100
    .local v0, groupOffset:I
    if-eqz p2, :cond_0

    .line 101
    iget-object v1, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mMoveAni:Lcom/nemustech/tiffany/world/TFHolder$MoveAnimation;

    invoke-virtual {v1, v0}, Lcom/nemustech/tiffany/world/TFHolder$MoveAnimation;->startMoveAnimation(I)V

    .line 106
    :goto_0
    return-void

    .line 103
    :cond_0
    const/4 v1, 0x0

    invoke-virtual {p0, v0, v1}, Lcom/nemustech/tiffany/world/TFGridHolder;->scrollHeadItemIndex(IZ)I

    .line 104
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFGridHolder;->requestLayout()V

    goto :goto_0
.end method

.method public setHeadItemIndex(IZ)V
    .locals 4
    .parameter "itemIndex"
    .parameter "showAnimation"

    .prologue
    .line 109
    invoke-virtual {p0, p1}, Lcom/nemustech/tiffany/world/TFGridHolder;->indexToGroup(I)I

    move-result v1

    iget v2, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mHeadItemIndex:I

    invoke-virtual {p0, v2}, Lcom/nemustech/tiffany/world/TFGridHolder;->indexToGroup(I)I

    move-result v2

    sub-int v0, v1, v2

    .line 110
    .local v0, groupOffset:I
    sget-object v1, Lcom/nemustech/tiffany/world/TFGridHolder;->TAG:Ljava/lang/String;

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "head groupOffset is: "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string v3, "( "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    iget v3, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mHeadItemIndex:I

    invoke-virtual {p0, v3}, Lcom/nemustech/tiffany/world/TFGridHolder;->indexToGroup(I)I

    move-result v3

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string v3, "->"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {p0, p1}, Lcom/nemustech/tiffany/world/TFGridHolder;->indexToGroup(I)I

    move-result v3

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v1, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 112
    if-eqz p2, :cond_0

    .line 113
    iget-object v1, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mMoveAni:Lcom/nemustech/tiffany/world/TFHolder$MoveAnimation;

    invoke-virtual {v1, v0}, Lcom/nemustech/tiffany/world/TFHolder$MoveAnimation;->startMoveAnimation(I)V

    .line 118
    :goto_0
    return-void

    .line 115
    :cond_0
    const/4 v1, 0x0

    invoke-virtual {p0, v0, v1}, Lcom/nemustech/tiffany/world/TFGridHolder;->scrollHeadItemIndex(IZ)I

    .line 116
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFGridHolder;->requestLayout()V

    goto :goto_0
.end method

.method public setScrollLimitOffset(II)V
    .locals 0
    .parameter "start"
    .parameter "end"

    .prologue
    .line 374
    iput p1, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mScrollStartIndexOffset:I

    .line 375
    iput p2, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mScrollEndIndexOffset:I

    .line 376
    return-void
.end method

.method protected shiftObjectsInSlots(IZ)V
    .locals 8
    .parameter "offset"
    .parameter "callListener"

    .prologue
    const/4 v7, 0x1

    .line 292
    iget-boolean v5, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mDelayedSetItemMode:Z

    if-eqz v5, :cond_0

    .line 293
    iput-boolean v7, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mNeedToSetItem:Z

    .line 295
    :cond_0
    const/4 v2, 0x0

    .line 296
    .local v2, oc:Lcom/nemustech/tiffany/world/TFObjectContainer;
    if-gez p1, :cond_2

    .line 297
    neg-int p1, p1

    .line 298
    const/4 v0, 0x0

    .local v0, i:I
    :goto_0
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFGridHolder;->getSlotCount()I

    move-result v5

    if-ge v0, v5, :cond_5

    .line 299
    if-ge v0, p1, :cond_1

    .line 300
    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v5}, Ljava/util/LinkedList;->removeLast()Ljava/lang/Object;

    move-result-object v2

    .end local v2           #oc:Lcom/nemustech/tiffany/world/TFObjectContainer;
    check-cast v2, Lcom/nemustech/tiffany/world/TFObjectContainer;

    .line 301
    .restart local v2       #oc:Lcom/nemustech/tiffany/world/TFObjectContainer;
    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v5, v2}, Ljava/util/LinkedList;->addFirst(Ljava/lang/Object;)V

    .line 302
    sub-int v5, p1, v7

    sub-int/2addr v5, v0

    invoke-virtual {p0, v5}, Lcom/nemustech/tiffany/world/TFGridHolder;->calculateItemIndexOfSlot(I)I

    move-result v5

    invoke-virtual {p0, v2, v5}, Lcom/nemustech/tiffany/world/TFGridHolder;->setItemIndexOfObjectInSlot(Lcom/nemustech/tiffany/world/TFObjectContainer;I)V

    .line 298
    :goto_1
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    .line 305
    :cond_1
    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v5, v0}, Ljava/util/LinkedList;->get(I)Ljava/lang/Object;

    move-result-object v2

    .end local v2           #oc:Lcom/nemustech/tiffany/world/TFObjectContainer;
    check-cast v2, Lcom/nemustech/tiffany/world/TFObjectContainer;

    .line 306
    .restart local v2       #oc:Lcom/nemustech/tiffany/world/TFObjectContainer;
    invoke-virtual {p0, v0}, Lcom/nemustech/tiffany/world/TFGridHolder;->calculateItemIndexOfSlot(I)I

    move-result v5

    invoke-virtual {p0, v2, v5}, Lcom/nemustech/tiffany/world/TFGridHolder;->setItemIndexOfObjectInSlot(Lcom/nemustech/tiffany/world/TFObjectContainer;I)V

    goto :goto_1

    .line 310
    .end local v0           #i:I
    :cond_2
    if-lez p1, :cond_4

    .line 311
    const/4 v0, 0x0

    .restart local v0       #i:I
    :goto_2
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFGridHolder;->getSlotCount()I

    move-result v5

    if-ge v0, v5, :cond_5

    .line 312
    if-ge v0, p1, :cond_3

    .line 313
    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v5}, Ljava/util/LinkedList;->removeFirst()Ljava/lang/Object;

    move-result-object v2

    .end local v2           #oc:Lcom/nemustech/tiffany/world/TFObjectContainer;
    check-cast v2, Lcom/nemustech/tiffany/world/TFObjectContainer;

    .line 314
    .restart local v2       #oc:Lcom/nemustech/tiffany/world/TFObjectContainer;
    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v5, v2}, Ljava/util/LinkedList;->addLast(Ljava/lang/Object;)V

    .line 315
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFGridHolder;->getSlotCount()I

    move-result v5

    sub-int/2addr v5, v7

    invoke-virtual {p0, v5}, Lcom/nemustech/tiffany/world/TFGridHolder;->calculateItemIndexOfSlot(I)I

    move-result v5

    sub-int/2addr v5, v7

    invoke-virtual {p0, v2, v5}, Lcom/nemustech/tiffany/world/TFGridHolder;->setItemIndexOfObjectInSlot(Lcom/nemustech/tiffany/world/TFObjectContainer;I)V

    .line 311
    :goto_3
    add-int/lit8 v0, v0, 0x1

    goto :goto_2

    .line 318
    :cond_3
    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mObjectSlots:Ljava/util/LinkedList;

    sub-int v6, v0, p1

    invoke-virtual {v5, v6}, Ljava/util/LinkedList;->get(I)Ljava/lang/Object;

    move-result-object v2

    .end local v2           #oc:Lcom/nemustech/tiffany/world/TFObjectContainer;
    check-cast v2, Lcom/nemustech/tiffany/world/TFObjectContainer;

    .line 319
    .restart local v2       #oc:Lcom/nemustech/tiffany/world/TFObjectContainer;
    sub-int v5, v0, p1

    invoke-virtual {p0, v5}, Lcom/nemustech/tiffany/world/TFGridHolder;->calculateItemIndexOfSlot(I)I

    move-result v5

    invoke-virtual {p0, v2, v5}, Lcom/nemustech/tiffany/world/TFGridHolder;->setItemIndexOfObjectInSlot(Lcom/nemustech/tiffany/world/TFObjectContainer;I)V

    goto :goto_3

    .line 324
    .end local v0           #i:I
    :cond_4
    const/4 v4, 0x0

    .line 325
    .local v4, slotIndex:I
    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v5}, Ljava/util/LinkedList;->iterator()Ljava/util/Iterator;

    move-result-object v1

    .local v1, i$:Ljava/util/Iterator;
    :goto_4
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v5

    if-eqz v5, :cond_5

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Lcom/nemustech/tiffany/world/TFObjectContainer;

    .line 326
    .local v3, slot:Lcom/nemustech/tiffany/world/TFObjectContainer;
    invoke-virtual {p0, v4}, Lcom/nemustech/tiffany/world/TFGridHolder;->calculateItemIndexOfSlot(I)I

    move-result v5

    invoke-virtual {p0, v3, v5}, Lcom/nemustech/tiffany/world/TFGridHolder;->setItemIndexOfObjectInSlot(Lcom/nemustech/tiffany/world/TFObjectContainer;I)V

    .line 327
    add-int/lit8 v4, v4, 0x1

    goto :goto_4

    .line 332
    .end local v1           #i$:Ljava/util/Iterator;
    .end local v3           #slot:Lcom/nemustech/tiffany/world/TFObjectContainer;
    .end local v4           #slotIndex:I
    :cond_5
    if-eqz p1, :cond_6

    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mObjectShiftListener:Lcom/nemustech/tiffany/world/TFHolder$OnObjectShiftListener;

    if-eqz v5, :cond_6

    .line 333
    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mOnObjectShiftRunnable:Ljava/lang/Runnable;

    invoke-static {v5}, Lcom/nemustech/tiffany/world/TFWorld;->queueEvent(Ljava/lang/Runnable;)V

    .line 335
    :cond_6
    return-void
.end method

.method public updateLayout(I)Z
    .locals 6
    .parameter "tickPassed"

    .prologue
    const/4 v5, 0x1

    const/4 v4, 0x0

    .line 181
    const/4 v0, 0x0

    .line 182
    .local v0, updated:Z
    iget v1, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mHeadItemIndex:I

    invoke-virtual {p0, v1}, Lcom/nemustech/tiffany/world/TFGridHolder;->indexToGroup(I)I

    move-result v1

    iget v2, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mScrollStartIndexOffset:I

    neg-int v2, v2

    if-ge v1, v2, :cond_2

    .line 183
    iget v1, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mScrollStartIndexOffset:I

    neg-int v1, v1

    invoke-virtual {p0, v1, v4}, Lcom/nemustech/tiffany/world/TFGridHolder;->setHeadGroupIndex(IZ)V

    .line 187
    :cond_0
    :goto_0
    iget-object v1, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mMoveAni:Lcom/nemustech/tiffany/world/TFHolder$MoveAnimation;

    if-eqz v1, :cond_1

    iget-object v1, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mMoveAni:Lcom/nemustech/tiffany/world/TFHolder$MoveAnimation;

    invoke-virtual {v1, p1}, Lcom/nemustech/tiffany/world/TFHolder$MoveAnimation;->update(I)Z

    move-result v1

    if-eqz v1, :cond_1

    .line 188
    const/4 v0, 0x1

    .line 189
    :cond_1
    return v0

    .line 184
    :cond_2
    iget v1, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mHeadItemIndex:I

    invoke-virtual {p0, v1}, Lcom/nemustech/tiffany/world/TFGridHolder;->indexToGroup(I)I

    move-result v1

    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFGridHolder;->getGroupCount()I

    move-result v2

    sub-int/2addr v2, v5

    iget v3, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mScrollEndIndexOffset:I

    sub-int/2addr v2, v3

    if-le v1, v2, :cond_0

    .line 185
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFGridHolder;->getGroupCount()I

    move-result v1

    sub-int/2addr v1, v5

    iget v2, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mScrollEndIndexOffset:I

    sub-int/2addr v1, v2

    invoke-virtual {p0, v1, v4}, Lcom/nemustech/tiffany/world/TFGridHolder;->setHeadGroupIndex(IZ)V

    goto :goto_0
.end method

.method protected updateObject(Ljavax/microedition/khronos/opengles/GL10;IZ)Z
    .locals 7
    .parameter "gl"
    .parameter "tickPassed"
    .parameter "bDoGLCalc"

    .prologue
    const/4 v6, 0x0

    .line 139
    invoke-super {p0, p1, p2, p3}, Lcom/nemustech/tiffany/world/TFHolder;->updateObject(Ljavax/microedition/khronos/opengles/GL10;IZ)Z

    move-result v1

    .line 140
    .local v1, ret:Z
    const/4 v4, 0x0

    .line 142
    .local v4, updated:Z
    invoke-virtual {p0, p2}, Lcom/nemustech/tiffany/world/TFGridHolder;->updateLayout(I)Z

    move-result v5

    if-eqz v5, :cond_0

    .line 143
    const/4 v4, 0x1

    .line 146
    :cond_0
    iget-boolean v5, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mRefresh:Z

    if-eqz v5, :cond_1

    .line 147
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFGridHolder;->refreshSlotIndex()V

    .line 148
    iput-boolean v6, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mRefresh:Z

    .line 149
    const/4 v5, 0x1

    iput-boolean v5, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mLayoutObjects:Z

    .line 150
    const/4 v4, 0x1

    .line 153
    :cond_1
    iget-boolean v5, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mDelayedSetItemMode:Z

    if-eqz v5, :cond_3

    iget-boolean v5, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mSetItemNow:Z

    if-eqz v5, :cond_3

    .line 154
    const/4 v3, 0x0

    .line 155
    .local v3, slotIndex:I
    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v5}, Ljava/util/LinkedList;->iterator()Ljava/util/Iterator;

    move-result-object v0

    .local v0, i$:Ljava/util/Iterator;
    :goto_0
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v5

    if-eqz v5, :cond_2

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/nemustech/tiffany/world/TFObjectContainer;

    .line 156
    .local v2, slot:Lcom/nemustech/tiffany/world/TFObjectContainer;
    invoke-virtual {p0, v3}, Lcom/nemustech/tiffany/world/TFGridHolder;->calculateItemIndexOfSlot(I)I

    move-result v5

    invoke-virtual {p0, v2, v5}, Lcom/nemustech/tiffany/world/TFGridHolder;->setItemIndexOfObjectInSlot(Lcom/nemustech/tiffany/world/TFObjectContainer;I)V

    .line 157
    add-int/lit8 v3, v3, 0x1

    goto :goto_0

    .line 159
    .end local v2           #slot:Lcom/nemustech/tiffany/world/TFObjectContainer;
    :cond_2
    iput-boolean v6, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mSetItemNow:Z

    .line 160
    iput-boolean v6, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mNeedToSetItem:Z

    .line 168
    .end local v0           #i$:Ljava/util/Iterator;
    .end local v3           #slotIndex:I
    :cond_3
    iget-boolean v5, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mLayoutObjects:Z

    if-eqz v5, :cond_4

    .line 169
    iget v5, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mDeviation:F

    invoke-virtual {p0, v5}, Lcom/nemustech/tiffany/world/TFGridHolder;->layoutObjects(F)V

    .line 170
    iput-boolean v6, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mLayoutObjects:Z

    .line 171
    const/4 v4, 0x1

    .line 174
    :cond_4
    if-eqz v4, :cond_5

    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    if-eqz v5, :cond_5

    .line 175
    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFGridHolder;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    invoke-static {}, Lcom/nemustech/tiffany/world/TFWorld;->requestRender()V

    .line 177
    :cond_5
    return v1
.end method
